package com.ruoyi.system.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdverinfoMapper;
import com.ruoyi.system.domain.Adverinfo;
import com.ruoyi.system.service.IAdverinfoService;
import com.ruoyi.common.support.Convert;

/**
 * 广告 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-16
 */
@Service
public class AdverinfoServiceImpl implements IAdverinfoService 
{

	@Autowired
	private AdverinfoMapper adverinfoMapper;

	/**
     * 查询广告信息
     * 
     * @param advertinfoId 广告ID
     * @return 广告信息
     */
    @Override
	public Adverinfo selectAdverinfoById(Integer advertinfoId)
	{

	    return adverinfoMapper.selectAdverinfoById(advertinfoId);
	}
	
	/**
     * 查询广告列表
     * 
     * @param adverinfo 广告信息
     * @return 广告集合
     */
	@Override
	public List<Adverinfo> selectAdverinfoList(Adverinfo adverinfo)
	{
	    return adverinfoMapper.selectAdverinfoList(adverinfo);
	}
	
    /**
     * 新增广告
     * 
     * @param adverinfo 广告信息
     * @return 结果
     */
	@Override
	public int insertAdverinfo(Adverinfo adverinfo)
	{
	    return adverinfoMapper.insertAdverinfo(adverinfo);
	}
	
	/**
     * 修改广告
     * 
     * @param adverinfo 广告信息
     * @return 结果
     */
	@Override
	public int updateAdverinfo(Adverinfo adverinfo)
	{

		return adverinfoMapper.updateAdverinfo(adverinfo);
	}

	/**
     * 删除广告对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAdverinfoByIds(String ids)
	{
		return adverinfoMapper.deleteAdverinfoByIds(Convert.toStrArray(ids));
	}
	
}
